package android.app;

import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.os.IBinder;

/**
 * @author slc
 * @date 2022/03/29 上午 11:59
 */
public abstract class Service extends Context {
    public Service() {
        super();
    }

    public abstract IBinder onBind(Intent arg0);

    public void onCreate() {
    }

    public int onStartCommand(Intent intent, int flags, int startId) {
        return 0;
    }

    public void startForeground(int notificationId, Notification notification,int remoteMessaging) {
        //啥也不做
    }
    public void startForeground(int notificationId, Notification notification) {
        //啥也不做
    }

    public void stopForeground(boolean removeNotification) {
        //啥也不做
    }


    public void onDestroy() {

    }

    public void stopSelf() {
        Intent intent = new Intent();
        intent.setComponent(new ComponentName(getPackageName(), getClass().getName()));
        stopService(intent);
    }
}
